home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-02-26 | 2.5 KB | 120 lines |
- ' *************************************************************
- '
- ' RANDOM NUMBER ANALYZER
- ' ======================
- '
- ' or
- '
- ' a sad example of what people with
- ' too much time on their hands get up to!
- '
- ' /\/\/\/\/\/\/\/\/\
- ' By: Paul Nordovics
- ' \/\/\/\/\/\/\/\/\/
- '
- ' shows the occurence of numbers
- ' 1-49 which are generated at random
- '
- ' total occurences of a given number =
- ' (bottom graph value*50)+top graph value
- ' as if anybody's gonner bother anyway!!!
- '
- ' *************************************************************
- '
- Hide
- '
- ' *************
- ' set up screen
- ' *************
- Unpack 1 To 0
- Curs Off : Flash Off
- Screen Display 0,128,45,,
- '
- Dim NUMBER(49)
- '
- Randomize Timer
- '
- ' *************************************************************
- ' MAIN
- ' *************************************************************
- '
- Do
- ' **************
- ' get RND number
- ' **************
- Repeat
- K=Rnd(49)
- Until K>0
- '
- ' ***********************
- ' increase number counter
- ' ***********************
- Add NUMBER(K),1
- '
- ' *******************************
- ' work out y values for each graf
- ' *******************************
- GY2=NUMBER(K)/50
- GY1=NUMBER(K)-(GY2*50)
- '
- ' *************
- ' update graphs
- ' *************
- Gosub BLANK_TOP_GRAPH
- Gosub _DRAW_TOP_GRAPH
- Gosub BLANK_BOTTOM_GRAPH
- Gosub _DRAW_BOTTOM_GRAPH
- Loop
- '
- ' -------------------------------------------------------------
- '
- BLANK_TOP_GRAPH:
- ' *****
- ' blank
- ' *****
- X=(K*6)+6 : Y=110
- Ink 3
- For L=1 To 50
- Draw X,Y To X+4,Y
- Add Y,-2
- Next L
- Return
- '
- ' -------------------------------------------------------------
- '
- _DRAW_TOP_GRAPH:
- If GY1>0
- X=(K*6)+6 : Y=110
- Ink 2
- For L=1 To GY1
- Draw X,Y To X+4,Y
- Add Y,-2
- Next L
- End If
- Return
- '
- ' -------------------------------------------------------------
- '
- BLANK_BOTTOM_GRAPH:
- X=(K*6)+6 : Y=232
- Ink 3
- For L=1 To 50
- Draw X,Y To X+4,Y
- Add Y,-2
- Next L
- Return
- '
- ' -------------------------------------------------------------
- '
- _DRAW_BOTTOM_GRAPH:
- If GY2>0
- Ink 2
- X=(K*6)+6 : Y=232
- For L=1 To GY2
- Draw X,Y To X+4,Y
- Add Y,-2
- Next L
- End If
- Return
- '
- ' -------------------------------------------------------------